package com.enterprise.dao.impl;

import com.enterprise.dao.BaseDao;
import com.enterprise.dao.TeamDao;
import com.enterprise.entity.Team;
import com.enterprise.entity.page.PageModel;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository("teamDao")
public class TeamDaoImpl implements TeamDao {

	@Resource
	private BaseDao dao;

	public void setDao(BaseDao dao) {
		this.dao = dao;
	}

	@Override
	public int insert(Team team) {
		return dao.insert("team.insert", team);
	}

	@Override
	public int delete(Team team) {
		return dao.delete("team.delete", team);
	}

	@Override
	public int update(Team team) {
		return dao.update("team.update", team);
	}

	@Override
	public Team selectOne(Team team) {
		return (Team) dao.selectOne("team.selectOne", team);
	}

	@Override
	public PageModel selectPageList(Team team) {
		return dao.selectPageList("team.selectPageList", "team.selectPageCount", team);
	}

	@Override
	public List<Team> selectList(Team team) {
		return dao.selectList("team.selectList", team);
	}

	@Override
	public int deleteById(int id) {
		return dao.delete("team.deleteById",id);
	}

	@Override
	public Team selectById(int id) {
		return (Team) dao.selectOne("team.selectById",id);
	}
}
